// pages/Cprofile/Cprofile.js
Page({

  /**
   * 页面的初始数据
   */
  data: {

    prenext: "../Ourteam/Ourteam",
    preprve: "../index/index",
    page: 2,
    cptitle:{
      zw:"公司简介",
      yw:"Company profile"
    },
    startpoint: [],
    movePoint: [],
    opacitycontainer: {},
    rightToleft:{},
    containeran:"containeran"
  },
  touchstartfun: function (e) {
    var that = this;
    //开始触摸，获取触摸坐标
    that.setData({
      startpoint: [e.touches[0].pageX, e.touches[0].pageY]
    });
  },
  touchmovefun: function (e) {
    //触摸移动中，获取触摸坐标
    var that = this;
    that.setData({
      movePoint: [e.touches[0].pageX, e.touches[0].pageY]
    });
    var startY = this.data.startpoint[1];
    var moveY = this.data.movePoint[1];
  
  },
  touchendfun: function (e) {
    var that = this;
    var startY = this.data.startpoint[1];
    var moveY = this.data.movePoint[1];
    if (startY - moveY > 80) {
      wx.reLaunch({
        url: that.data.prenext
      })
    }
    else if (startY - moveY < -80) {
      wx.reLaunch({
        url: that.data.preprve
      })
    }
  }, 
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  

  /**
   * 生命周期函数--监听页面显示
   */

  onReady: function () {
      this.setData({
        bg2leftstyle:"bg2leftstyle",
        styleArr: ["comileftstyle", "comeimgstyle","viewstyle"],
        bottomdata: {
          page: 2,
          styleArr: ["bottomstyleArr1", "bottomstyleArr2", "viewstyleArr"]
        },
        cptitle: {
          cptitlestyle:"cptitlestyle",
          zw: "公司简介",
          yw: "Company profile"
        },
      })
    var animation = wx.createAnimation({
      duration: 500,
      timingFunction: 'ease'
    })
    animation.translateX(0).step();
    this.setData({
      rightToleft: animation.export()
    })
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})